{"ast":null,"code":"var _jsxFileName = \"/data/messenger.client/src/pages/Home/Profile/index.tsx\",\n  _s = $RefreshSig$();\nimport React from 'react';\nimport { Home } from \"../../\";\nimport { Circle } from 'rc-progress';\nimport { observer } from \"mobx-react-lite\";\nimport { Context } from \"../../../index\";\nimport { profileCompletionPercentage } from \"../../../utils/User\";\nimport Switch from '@mui/material/Switch';\nimport { Button } from '../../../components';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\nconst Profile = () => {\n  _s();\n  const {\n    store\n  } = React.useContext(Context);\n  const [profilePercent, setProfilePercent] = React.useState(0);\n  const [loadingToggle, setLoadingToggle] = React.useState(true);\n  const memoizedProfile = React.useMemo(() => profileCompletionPercentage(store.getProfile()), [store.getProfile()]);\n  React.useEffect(() => {\n    setProfilePercent(memoizedProfile);\n  }, [store.getProfile()]);\n  const handleClick = () => {\n    setLoadingToggle(false);\n  };\n  return /*#__PURE__*/_jsxDEV(Home, {\n    childrenFirst: /*#__PURE__*/_jsxDEV(\"div\", {\n      className: \"messenger__sidebar-item\",\n      children: [/*#__PURE__*/_jsxDEV(\"div\", {\n        className: \"messenger__sidebar-item-header\",\n        children: /*#__PURE__*/_jsxDEV(\"div\", {\n          className: \"messenger__sidebar-item-header-top\",\n          children: /*#__PURE__*/_jsxDEV(\"span\", {\n            children: \"\\u041D\\u0430\\u0441\\u0442\\u0440\\u043E\\u0439\\u043A\\u0438 \\u043F\\u0440\\u043E\\u0444\\u0438\\u043B\\u044F\"\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 34,\n            columnNumber: 29\n          }, this)\n        }, void 0, false, {\n          fileName: _jsxFileName,\n          lineNumber: 33,\n          columnNumber: 25\n        }, this)\n      }, void 0, false, {\n        fileName: _jsxFileName,\n        lineNumber: 32,\n        columnNumber: 21\n      }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n        className: \"messenger__sidebar-profile\",\n        children: [/*#__PURE__*/_jsxDEV(Circle, {\n          percent: profilePercent,\n          strokeWidth: 3,\n          className: \"messenger__sidebar-profile-progress\"\n        }, void 0, false, {\n          fileName: _jsxFileName,\n          lineNumber: 38,\n          columnNumber: 25\n        }, this), /*#__PURE__*/_jsxDEV(\"p\", {\n          className: \"messenger__sidebar-profile-progressInfo\",\n          children: [\"\\u041F\\u0440\\u043E\\u0444\\u0438\\u043B\\u044C \\u0437\\u0430\\u043F\\u043E\\u043B\\u043D\\u0435\\u043D \\u043D\\u0430: \", profilePercent.toString().slice(0, 5), \"%\"]\n        }, void 0, true, {\n          fileName: _jsxFileName,\n          lineNumber: 43,\n          columnNumber: 25\n        }, this)]\n      }, void 0, true, {\n        fileName: _jsxFileName,\n        lineNumber: 37,\n        columnNumber: 21\n      }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n        className: \"messenger__sidebar-profileControl\",\n        children: [/*#__PURE__*/_jsxDEV(\"div\", {\n          className: \"messenger__sidebar-profileControl-top\",\n          children: [/*#__PURE__*/_jsxDEV(Switch, {\n            checked: !loadingToggle,\n            onChange: () => setLoadingToggle(!loadingToggle),\n            name: \"special\"\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 49,\n            columnNumber: 29\n          }, this), /*#__PURE__*/_jsxDEV(\"span\", {\n            className: \"messenger__sidebar-profileControl-top-toggleInfo\",\n            children: \"\\u0421\\u043F\\u0435\\u0446\\u0438\\u0430\\u043B\\u044C\\u043D\\u044B\\u0435 \\u0432\\u043E\\u0437\\u043C\\u043E\\u0436\\u043D\\u043E\\u0441\\u0442\\u0438\"\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 54,\n            columnNumber: 29\n          }, this)]\n        }, void 0, true, {\n          fileName: _jsxFileName,\n          lineNumber: 48,\n          columnNumber: 25\n        }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n          className: \"messenger__sidebar-profileControl-main\",\n          children: [/*#__PURE__*/_jsxDEV(Button, {\n            fullWidth: false,\n            text: 'Изменить профиль'\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 59,\n            columnNumber: 29\n          }, this), /*#__PURE__*/_jsxDEV(Button, {\n            fullWidth: false,\n            text: 'Удалить профиль'\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 63,\n            columnNumber: 29\n          }, this)]\n        }, void 0, true, {\n          fileName: _jsxFileName,\n          lineNumber: 58,\n          columnNumber: 25\n        }, this)]\n      }, void 0, true, {\n        fileName: _jsxFileName,\n        lineNumber: 47,\n        columnNumber: 21\n      }, this)]\n    }, void 0, true, {\n      fileName: _jsxFileName,\n      lineNumber: 31,\n      columnNumber: 17\n    }, this)\n  }, void 0, false, {\n    fileName: _jsxFileName,\n    lineNumber: 29,\n    columnNumber: 9\n  }, this);\n};\n_s(Profile, \"+5hMDtBTpQzR5GhnCVrVyZDi2Wk=\");\n_c = Profile;\nexport default _c2 = observer(Profile);\nvar _c, _c2;\n$RefreshReg$(_c, \"Profile\");\n$RefreshReg$(_c2, \"%default%\");","map":{"version":3,"names":["React","Home","Circle","observer","Context","profileCompletionPercentage","Switch","Button","Profile","store","useContext","profilePercent","setProfilePercent","useState","loadingToggle","setLoadingToggle","memoizedProfile","useMemo","getProfile","useEffect","handleClick","toString","slice"],"sources":["/data/messenger.client/src/pages/Home/Profile/index.tsx"],"sourcesContent":["import React from 'react';\nimport {Home} from \"../../\";\nimport  {Circle} from 'rc-progress';\nimport {observer} from \"mobx-react-lite\";\nimport {Context} from \"../../../index\";\nimport {profileCompletionPercentage} from \"../../../utils/User\";\nimport Switch from '@mui/material/Switch';\nimport {Button} from '../../../components'\n\nconst Profile = () => {\n    const {store} = React.useContext(Context);\n    const [profilePercent, setProfilePercent] = React.useState<number>(0);\n    const [loadingToggle, setLoadingToggle] = React.useState(true);\n\n    const memoizedProfile = React.useMemo(\n        () => profileCompletionPercentage(store.getProfile()),\n        [store.getProfile()]\n    );\n\n    React.useEffect(() => {\n        setProfilePercent(memoizedProfile);\n    },[store.getProfile()]);\n\n    const handleClick = (): void => {\n        setLoadingToggle(false);\n    }\n\n    return (\n        <Home\n            childrenFirst={\n                <div className=\"messenger__sidebar-item\">\n                    <div className=\"messenger__sidebar-item-header\">\n                        <div className=\"messenger__sidebar-item-header-top\">\n                            <span>Настройки профиля</span>\n                        </div>\n                    </div>\n                    <div className=\"messenger__sidebar-profile\">\n                        <Circle\n                            percent={profilePercent}\n                            strokeWidth={3}\n                            className=\"messenger__sidebar-profile-progress\"\n                        />\n                        <p className=\"messenger__sidebar-profile-progressInfo\">\n                            Профиль заполнен на: {profilePercent.toString().slice(0, 5)}%\n                        </p>\n                    </div>\n                    <div className=\"messenger__sidebar-profileControl\">\n                        <div className=\"messenger__sidebar-profileControl-top\">\n                            <Switch\n                                checked={!loadingToggle}\n                                onChange={() => setLoadingToggle(!loadingToggle)}\n                                name=\"special\"\n                            />\n                            <span className=\"messenger__sidebar-profileControl-top-toggleInfo\">\n                                Специальные возможности\n                            </span>\n                        </div>\n                        <div className=\"messenger__sidebar-profileControl-main\">\n                            <Button\n                                fullWidth={false}\n                                text={'Изменить профиль'}\n                            />\n                            <Button\n                                fullWidth={false}\n                                text={'Удалить профиль'}\n                            />\n                        </div>\n                    </div>\n                </div>\n            }\n        />\n    );\n}\n\nexport default observer(Profile);"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAQC,IAAI,QAAO,QAAQ;AAC3B,SAASC,MAAM,QAAO,aAAa;AACnC,SAAQC,QAAQ,QAAO,iBAAiB;AACxC,SAAQC,OAAO,QAAO,gBAAgB;AACtC,SAAQC,2BAA2B,QAAO,qBAAqB;AAC/D,OAAOC,MAAM,MAAM,sBAAsB;AACzC,SAAQC,MAAM,QAAO,qBAAqB;AAAA;AAE1C,MAAMC,OAAO,GAAG,MAAM;EAAA;EAClB,MAAM;IAACC;EAAK,CAAC,GAAGT,KAAK,CAACU,UAAU,CAACN,OAAO,CAAC;EACzC,MAAM,CAACO,cAAc,EAAEC,iBAAiB,CAAC,GAAGZ,KAAK,CAACa,QA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